interface Todo {
  title: string;
  description: string;
  completed: boolean;
}

// 解法1. 手动实现 Exclude
type T = keyof Todo;
const t1: T = "completed";
// type MyOmit<T, K extends keyof T> = {
//   [P in MyExcludeType<keyof T, K>]: T[P];
// };
type OmitTest1 = MyOmit<Todo, "completed">;
type OmitTest2 = MyOmit<Todo, "description">;

type MyExcludeType<T, U> = T extends U ? never : T;
type OmitTest3 = MyExcludeType<"1" | "2" | "3", "1">; // "2" | "3"

// 解法2. 使用 Exclude
type MyOmit<T, K extends keyof T> = {
  [P in Exclude<keyof T, K>]: T[P];
};
